package com.jinxiangyang.sensitive;

import com.jinxiangyang.utils.SensitiveInfoUtils;
import com.jinxiangyang.utils.enums.SensitiveDefaultLengthType;

/**
 * @File SensitiveMobile.java
 * @Author lzq
 * @Create 2023/8/19 16:28
 */
public class SensitiveMobile implements IStrategy {

    @Override
    public String desensitization(String mobile,int begin ,int end) {
        if(begin != SensitiveDefaultLengthType.MOBILE.getBegin() && begin !=0 &&
                end != SensitiveDefaultLengthType.MOBILE.getEnd() && end !=0){
            return SensitiveInfoUtils.mobilePhone(mobile,begin,end);
        }
        return SensitiveInfoUtils.mobilePhone(mobile, SensitiveDefaultLengthType.MOBILE.getBegin(), SensitiveDefaultLengthType.MOBILE.getEnd());
    }

}
